package net.muhu.channel.service;

import net.muhu.domain.Location;
import net.muhu.domain.Musiverse;

public class MusiverseServiceInMemoryImpl implements MusiverseServiceInMemory {

	protected Musiverse musiverse;

	public MusiverseServiceInMemoryImpl() {
		super();
	}

	public void setMusiverse(Musiverse musiverse) {
		this.musiverse = musiverse;
	}

	@Override
	public Musiverse getMusiverse(String id) {
		return musiverse;
	}

	@Override
	public String addLocation(Location location) {
		try {
			musiverse.getLocation().add(location);
			return location.getId();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

}